package com.bnp.reporting.java8.date;

import java.time.Duration;
import java.time.Instant;

/**
 * Created by adib on 11/11/14.
 */
public class NewDate {
    public static void main(String[] args) {

        Instant startInstant = Instant.now();
        System.out.println("start: " + startInstant);

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        Instant endInstant = Instant.now();
        System.out.println("end: " + endInstant);

        Duration duration = Duration.between(startInstant, endInstant);
        System.out.println("Duration: " + duration.toMillis() + " milliseconds");


    }
}
